#include<bits/stdc++.h>
using namespace std;

int a[2][2]={{129,25},{130,27}};

int main(){
    int n;
    int x,y,z;
    cin>>n;
    while(n){
    cin>>x>>y>>z;
    if(y>a[x][0])
        cout<<"ni li hai! ";
    else if(y==a[x][0])
        cout<<"wan mei! ";
    else
        cout<<"duo chi yu! ";
    if(z>a[x][1])
        cout<<"shao chi rou!\n";
    else if(z==a[x][1])
        cout<<"wan mei!\n";
    else
        cout<<"duo chi rou!\n";            
    n--;
    }
    return 0;
}